import {createRouter, createWebHistory} from 'vue-router'
//导入组件
import LoginPage from "@/view/LoginPage.vue";
import ConductVUE from '@/view/conduct/ConductVUE.vue'
import HomePage from "@/view/main/HomePage.vue";
import CompanyDetails from "@/view/main/CompanyDetails.vue";
import JobList from "@/view/main/JobList.vue";
import JobDetails from "@/view/main/JobDetails.vue";
import TestOSS from "@/view/main/TestOSS.vue";
import TestLJ from "@/view/main/TestLJ.vue";
import PostJob from "@/view/main/ResumeView.vue";
import GuidePage from "@/view/main/GuidePage.vue";
import ResetPassword from "@/view/login/ResetPassword.vue";
import UserPersonalPage from "@/view/main/UserPersonalPage.vue";
import DashBoard from "@/view/main/UserPersonalPartition/DashBoardPartition.vue";
import Resume from "@/view/main/UserPersonalPartition/ResumePartition.vue";
import Content1 from "@/view/behind/MainContent1.vue";
import Content2 from "@/view/behind/MainContent2.vue";
import Content3 from "@/view/behind/MainContent3.vue";
import Home from "@/view/behind/home.vue";
import CompanyPersonalPage from "@/view/main/CompanyPersonalPage.vue";
import CompanyResumeManage from "@/view/main/CompanyResumeManage.vue";
import ResumeView from "@/view/main/ResumeView.vue";
import RecommendJobPage from "@/view/main/RecommendJobPage.vue";
import RecommendResumePage from "@/view/main/RecommendResumePage.vue";

//定义路由关系
const routes = [
    {
        name: 'login',
        path: '/login',
        component: LoginPage
    },
    {
        name: 'conduct',
        path: '/conduct',
        component: ConductVUE
    },
    {
        name: 'behind',
        path: '/home',
        component: Home,
        //让主体内容默认显示的是ArticleManage页面内容
        redirect: '/behind/content1',
        children:[
            {path: '/behind/content1', component: Content1},
            {path: '/behind/content2', component: Content2},
            {path: '/behind/content3', component: Content3},
        ]
    },
    {
        name: 'HomePage',
        path: '/HomePage',
        component: HomePage
    },
    {
        name: 'TestOSS',
        path: '/testOSS',
        component: TestOSS
    },
    {
        name: 'TestLJ',
        path: '/testlj',
        component: TestLJ
    },

    {
        name: 'CompanyDetails',
        path: '/CompanyDetails/:companyId?',
        component: CompanyDetails
    },

    {
        name: 'JobList',
        path: '/JobList/:jobTitle?/:location?',
        component: JobList
    },

    {
        name: 'JobDetails',
        path: '/JobDetails/:jobId?',
        component: JobDetails
    },

    {
        name: 'PostJob',
        path: '/PostJob',
        component: PostJob
    },

    {
        name: 'GuidePage',
        path: '/GuidePage',
        component: GuidePage
    },
    {
        name: 'PostJob',
        path: '/PostJob',
        component: PostJob
    },
    {
        name: 'test',
        path: '/test',
        component: () => import("@/view/analysis/test.vue")
    },
    {
        name: 'analysisResume',
        path: '/analysisResume',
        component: () => import("@/view/analysis/analysisResume.vue")
    },
    {
        name: 'recruitTest',
        path: '/recruitTest',
        component: () => import("@/view/analysis/recruitTest.vue")
    },
    {
        name: 'ResetPassword',
        path: '/resetPassword',
        component: ResetPassword
    },

    {
        name: 'UserPersonalPage',
        path: '/UserPersonalPage',
        component: UserPersonalPage
    },
    {
        name: 'DashBoard',
        path: '/DashBoard',
        component: DashBoard
    },
    {
        name: 'CompanyPersonalPage',
        path: '/CompanyPersonalPage',
        component: CompanyPersonalPage
    },
    {
        name: 'Resume',
        path: '/Resume',
        component: Resume
    },
    {
        name: 'CompanyResumeManage',
        path: '/CompanyResumeManage/:jobId?',
        component: CompanyResumeManage
    },
    {
        name: 'ResumeView',
        path: '/ResumeView',
        component: ResumeView
    },
    {
        name: 'RecommendJobPage',
        path: '/RecommendJobPage',
        component: RecommendJobPage
    },
    {
        name: 'RecommendResumePage',
        path: '/RecommendResumePage',
        component: RecommendResumePage
    },
]

//创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes: routes
})

//导出路由
export default router
